import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/homePage'
    },
    {
      path: '/',
      component: resolve => require(['../components/common/Home.vue'], resolve),
      meta: { title: '自述文件' },
      children: [
        {
          path: '/homePage',
          component: resolve => require(['../components/page/homePage/homePage.vue'], resolve),
          meta: { title: '首页' }
        },
        {
          path: '/userManagement',
          component: resolve => require(['../components/page/userManagement/userManagement.vue'], resolve),
          meta: { title: '员工列表' }
        },
        {
          path: '/custom',
          component: resolve => require(['../components/page/custom/index.vue'], resolve),
          meta: { title: '客户信息' }
        },
        {
          path: "/roleManagement",
          component: (resolve) =>
            require([
              "../components/page/AuthorityManagement/RoleManagement.vue",
            ], resolve),
          meta: { keepAlive: true, title: "角色管理" },
        },
        {
          path: "/personManagement",
          component: (resolve) =>
            require([
              "../components/page/AuthorityManagement/personManagement.vue",
            ], resolve),
          meta: { keepAlive: true, title: "账号列表" },
        },
        {
          path: '/workDone',
          component: resolve => require(['../components/page/workDone/index.vue'], resolve),
          meta: { title: '对冲列表' }
        },
        {
          path: '/staffProductionRecord',
          component: resolve => require(['../components/page/staffProductionRecord/index.vue'], resolve),
          meta: {title: '用工列表'}
        },
        {
          path: '/orderList',
          component: resolve => require(['../components/page/order/list.vue'], resolve),
          meta: { title: '订单列表' }
        },

        {
          path: '/prodList',
          component: resolve => require(['../components/page/order/prodList.vue'], resolve),
          meta: { title: '订单流转视图' }
        },

        {
          path: '/orderDetail',
          component: resolve => require(['../components/page/order/detail.vue'], resolve),
          meta: { title: '订单详情' }
        },
        {
          path: '/replenishment',
          component: resolve => require(['../components/page/order/replenishment.vue'], resolve),
          meta: { title: '补料申请' }
        },
        {
          path: '/flowDetail',
          component: resolve => require(['../components/page/order/flowDetail.vue'], resolve),
          meta: { title: '订单流转详情' }
        },
        {
          path: '/updateFlowDetail',
          component: resolve => require(['../components/page/order/updateFlowDetail.vue'], resolve),
          meta: { title: '订单流转详情' }
        },
        {
          path: '/404',
          component: resolve => require(['../components/page/404.vue'], resolve),
          meta: { title: '404' }
        },
        {
          path: '/403',
          component: resolve => require(['../components/page/403.vue'], resolve),
          meta: { title: '403' }
        }
      ]
    },
    {
      path: '/login',
      component: resolve => require(['../components/page/Login.vue'], resolve)
    },
    {
      path: '/circulation',
      component: resolve => require(['../components/page/circulation/index.vue'], resolve),
      meta: { title: '工序流转报送' }
    },
    {
      path: '/flow',
      component: resolve => require(['../components/page/circulation/flow.vue'], resolve),
      meta: { title: '工序流转报送' }
    },
    {
      path: '/replenishmentList',
      component: resolve => require(['../components/page/circulation/replenishmentList.vue'], resolve),
      meta: { title: '批量补料' }
    },

    {
      path: '/backList',
      component: resolve => require(['../components/page/circulation/backList.vue'], resolve),
      meta: { title: '批量回退' }
    },
    {
      path: '/update',
      component: resolve => require(['../components/page/circulation/update.vue'], resolve),
      meta: { title: '工序流转报送' }
    },
    {
      path: '/print',
      component: resolve => require(['../components/page/print.vue'], resolve),
      meta: { title: 'print' }
    },
    {
      path: '*',
      redirect: '/404'
    }
  ]
})
